import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/movie',  // 重定向:重新指向其它path,会改变网址 ，页面默认进来是/ ,当我一访问/ 让路由强行指向/home/movie
  },
  {
    path: '/my', // 不带tabbaer的
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/my')
  },
  {
    path:"/home",
    component:()=>import("../views/home"),
    children:[
      {
        path:"/home/movie",
        component:()=>import("../views/movie")
      }
    ]
  },
  {
    path:"/detail",
    component:()=>import("../views/detail")
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
